import { request } from '@pkg/request/src';

export enum Api {
  page = '/backcardRecord/page',
  list = '/backcardRecord/list',
  get = '/backcardRecord/get',
  add = '/backcardRecord/save',
  update = '/backcardRecord/update',
  remove = '/backcardRecord/remove',
  checkSub = '/backcardRecord/checkSub',
}

export const list = () =>
  request.get(
    { url: Api.list },
    {
      errorMessageMode: 'none',
      successMessageMode: 'none',
    },
  );

export const getBackcardRecordDetail = (params) =>
  request.get(
    {
      url: Api.get,
      params: params,
    },
    { errorMessageMode: 'none', successMessageMode: 'none' },
  );

export const checkSub = (params) =>
  request.post(
    {
      url: Api.checkSub,
      params: params,
    },
    { errorMessageMode: 'none' },
  );
